#include "threadPool.h"

//任务队列,线程,锁,条件变量 --初始化
int threadPoolInit(threadPool_t* pthreadPool,int workerNum){
    tidArrInit(&pthreadPool->tidArr,workerNum);//初始化线程池
    taskQueueInit(&pthreadPool->taskQueue);//初始化任务队列
    pthread_mutex_init(&pthreadPool->mutex,NULL);//初始化线程锁
    pthread_cond_init(&pthreadPool->cond,NULL);//初始化线程的条件变量
    pthreadPool->exitflag = 0;

    return 0;
}
